package com.nineclock.system.controller;

import com.nineclock.attendance.dto.AttendGroupDTO;
import com.nineclock.common.entity.Result;
import com.nineclock.system.service.SysDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/department")
public class SysDepartmentController {

    @Autowired
    private SysDepartmentService departmentService;

    /**
     * 根据员工id获得部门从低到高级别的部门ID数组
     * @param
     * @return
     */
    @GetMapping("/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@PathVariable("companyUserId") Long companyUserId) {
        return Result.success(departmentService.queryDepartmentsByUserId(companyUserId));
    }

}